package com.agilegroup.crm.ui.actions;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

/**
 * @author Hisham
 *
 */
public class DialogHandler {

	public static void makePhoneCall(String phoneNumber,Context context){
		Intent callIntent = new Intent(Intent.ACTION_CALL);
	    callIntent.setData(Uri.parse("tel:"+phoneNumber));
	    context.startActivity(callIntent);
	}
	public static void sendMessage(String phoneNumber,Context context){
		Intent phoneIntent = new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms",phoneNumber, null)); 
		context.startActivity(Intent.createChooser(phoneIntent, "Send SMS"));
	}
	public static void sendEmail(String email,Context context){
		Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto",email, null)); 
		//email_intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject text here"); 
		//email_intent.putExtra(android.content.Intent.EXTRA_TEXT,"Body text here"); 
		context.startActivity(Intent.createChooser(emailIntent, "Send Email"));
	}
}
